<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.validation.min.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/admincp.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.tooltip.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.cookie.js"></script>
<link href="{HEJIN_PATH}public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile2" />
<link href="{HEJIN_PATH}public/admin/css/style.css" rel="stylesheet" type="text/css"/>


<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
<div class="h3" style="width:auto"><!--{eval echo stripslashes($flinfo['title']);}--> -- {lang hejin_box:addnews}</div>
      <ul class="tab-base">
        <li><a href="admin.php?action=plugins&operation=config&do={$_GET['do']}&identifier=hejin_box&pmod=windex" class="current"><span>{lang hejin_box:wfenlei}</span></a></li>
      </ul>
    </div>
  </div>
  <form id="add_form" method="post" enctype="multipart/form-data" action="">
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <input type="hidden" name="fid" value="$fid" />
    <table class="table tb-type2">
      <tbody>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_title">{lang hejin_box:title}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="" name="title" id="class_name" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_text">{lang hejin_box:text}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><textarea name="text" class="tarea" id="statistics_code"></textarea></td>
          </tr>

        
        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_pic">{lang hejin_box:picurl}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="" name="pic" id="class_name" class="txt"></td>
          <td class="vatop tips">{lang hejin_box:picurlts} 360px * 200px</td>
        </tr>


        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_content">{lang hejin_box:content}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><textarea name="content" class="tarea" id="statistics_code" style="width:700px;height:300px;visibility:hidden;"></textarea>
          <script src="{HEJIN_PATH}public/kindeditor/kindeditor-min.js" charset="utf-8"></script>
<script src="{HEJIN_PATH}public/kindeditor/lang/zh_CN.js" charset="utf-8"></script>
<script>
	var KE;
  KindEditor.ready(function(K) {
        KE = K.create("textarea[name='content']", {
						items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about'],
						cssPath : "{HEJIN_PATH}public/kindeditor/themes/default/default.css",
						allowImageUpload : false,
						allowFlashUpload : false,
						allowMediaUpload : false,
						allowFileManager : false,
						filterMode: false,
						syncType:"form",
						afterCreate : function() {
							var self = this;
							self.sync();
						},
						afterChange : function() {
							var self = this;
							self.sync();
						},
						afterBlur : function() {
							var self = this;
							self.sync();
						}
        });
			KE.appendHtml = function(id,val) {
				this.html(this.html() + val);
				if (this.isCreated) {
					var cmd = this.cmd;
					cmd.range.selectNodeContents(cmd.doc.body).collapse(false);
					cmd.select();
				}
				return this;
			}
	});
</script>
         </td>
          <td class="vatop tips"><a href="http://wxedit.yead.net/" target="_blank">{lang hejin_box:wxbianjiqi}</a></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="replyurl">{lang hejin_box:replyurl}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="" name="url" id="replyurl" class="txt"></td>
          <td class="vatop tips">{lang hejin_box:urlts}</td>
        </tr>




 
         <tr>
          <td colspan="2" class="required"><label class="validation" for="sort">{lang hejin_box:paixu}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input id="sort" name="sort" type="text" class="txt" value="0" /></td>
          <td class="vatop tips">{lang hejin_box:paixuts}</td>
        </tr>
 
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_istj">{lang hejin_box:istjhd}</label></td>
        </tr>

<tr style="background: none repeat scroll 0% 0% rgb(255, 255, 255);" class="noborder">
          <td class="vatop rowform onoff"><label for="istj1" class="cb-enable"><span>{lang hejin_box:shi}</span></label>
            <label for="istj0" class="cb-disable selected"><span>{lang hejin_box:fou}</span></label>
            <input id="istj1" name="istj" value="1" type="radio">
            <input id="istj0" name="istj" checked="checked" value="0" type="radio"></td>
          <td class="vatop tips">{lang hejin_box:istjhdts}</td>
        </tr>
 
 
 
      </tbody>
      <tfoot>
        <tr>
          <td colspan="2"><input name="add_news" class="btn" type="submit" value="{lang hejin_box:baocun}" /></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript">
$(document).ready(function(){




    $("#submit").click(function(){
        $("#add_form").submit();
    });

    $("input[nc_type='microshop_goods_class_image']").live("change", function(){
		var src = getFullPath($(this)[0]);
		$(this).parent().prev().find('.low_source').attr('src',src);
		$(this).parent().find('input[class="type-file-text"]').val($(this).val());
	});


    $('#add_form').validate({
        errorPlacement: function(error, element){
            error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        success: function(label){
            label.addClass('valid');
        },
        rules : {
            title: {
                required : true,
                maxlength : 255
            },
            text: {
                required : true,
                maxlength : 1000
            },
            sort: {
                required : true,
                digits: true,
			 },
        },
        messages : {
            title: {
                required : "{lang hejin_box:addmsga}",
                maxlength : jQuery.validator.format("{lang hejin_box:addmsgb}255{lang hejin_box:addmsgc}")
            },
            text: {
                required : "{lang hejin_box:addmsga}",
                maxlength : jQuery.validator.format("{lang hejin_box:addmsgb}1000{lang hejin_box:addmsgc}")
            },
            sort: {
                required : "{lang hejin_box:addmsga}",
				digits: "{lang hejin_box:addmsgd}",
				},
        }
    });
});
</script> 
